home *** CD-ROM | disk | FTP | other *** search
- /* _exit.c --- BIBLE pp. 84-85 */
- #include <stdio.h>
- main()
- {
- FILE *fp;
- char filename[40];
- printf("Enter name of file to be opened for writing:");
- gets(filename);
- if((fp = fopen(filename, "w+")) == NULL)
- {
- perror("File open error");
- abort();
- }
- fprint(fp, "If you use \"_exit\", this line will not appear in "
- "the file\nbecause it flushes buffers\n", filename);
- printf("TYPE %s to see if buffers were flushed\n", filename);
- _exit(0);
- }